#ifndef SETTINGSWINDOW_H
#define SETTINGSWINDOW_H

#include <QWidget>
#include <QSettings>

namespace Ui {
class SettingsWindow;
}

class SettingsWindow : public QWidget
{
    Q_OBJECT

public:
    struct logSettings{
        bool enableToFile;
        QString path;
        int maxSize;
        bool enableTimeshift;
        bool overwrite;
    };
    struct settingsWindow {
        logSettings log;
    };
    settingsWindow &settingsWin;

    SettingsWindow(settingsWindow &sw, QWidget *parent = nullptr);
    ~SettingsWindow();

signals:
    void sigSettingsValid(settingsWindow &sw);

private:
    Ui::SettingsWindow *ui;
    QSettings settings;

    void uiInit();
    void restoreSettings();
    void getSettings();

protected:
    void closeEvent(QCloseEvent *event);
private slots:
    void on_pushButton_save_clicked();
    void on_pushButton_quit_clicked();
    void on_pushButton_selectLogPath_clicked();
    void on_pushButton_setDefault_clicked();
};

#endif // SETTINGSWINDOW_H
